home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
60914
/
60914.xpi
/
chrome
/
content
/
options.js
< prev
next >
Wrap
Text File
|
2010-01-20
|
4KB
|
124 lines
PersonasRotatorOptions = {
load : function (event){
var showpersonasrotatortabnormalcontextcheckbox=document.getElementById("showpersonasrotatortabnormalcontextcheckbox");
var prefilluploadformcheckbox=document.getElementById("prefilluploadformcheckbox");
var logalertenabledcheckbox=document.getElementById("logalertenabledcheckbox");
var personasrotatorprefsinstance = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var showpersonasrotatortabnormalcontext = personasrotatorprefsinstance.getBoolPref("extensions.personasrotator.showpersonasrotatortabnormalcontext");
var prefilluploadform = personasrotatorprefsinstance.getBoolPref("extensions.personasrotator.prefilluploadform");
var logalertenabled = personasrotatorprefsinstance.getBoolPref("extensions.personasrotator.logalertenabled");
if(showpersonasrotatortabnormalcontext){
showpersonasrotatortabnormalcontextcheckbox.setAttribute("class","enabled");
showpersonasrotatortabnormalcontextcheckbox.setAttribute("checked","true");
}
else {
showpersonasrotatortabnormalcontextcheckbox.setAttribute("class","disabled");
showpersonasrotatortabnormalcontextcheckbox.setAttribute("checked","false");
}
if(prefilluploadform){
prefilluploadformcheckbox.setAttribute("class","enabled");
prefilluploadformcheckbox.setAttribute("checked","true");
}
else {
prefilluploadformcheckbox.setAttribute("class","disabled");
prefilluploadformcheckbox.setAttribute("checked","false");
}
if(logalertenabled){
logalertenabledcheckbox.setAttribute("class","enabled");
logalertenabledcheckbox.setAttribute("checked","true");
}
else {
logalertenabledcheckbox.setAttribute("class","disabled");
logalertenabledcheckbox.setAttribute("checked","false");
}
showpersonasrotatortabnormalcontextcheckbox.addEventListener("command",PersonasRotatorOptions.showpersonasrotatortabnormalcontextcheckboxOncommandHandler,false);
prefilluploadformcheckbox.addEventListener("command",PersonasRotatorOptions.prefilluploadformcheckboxOncommandHandler,false);
logalertenabledcheckbox.addEventListener("command",PersonasRotatorOptions.logalertenabledcheckboxOncommandHandler,false);
},
showpersonasrotatortabnormalcontextcheckboxOncommandHandler : function (event){
var personasrotatorprefsinstance = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
if (event.target.getAttribute("class")=="enabled") {
event.target.setAttribute("class","disabled");
personasrotatorprefsinstance.setBoolPref("extensions.personasrotator.showpersonasrotatortabnormalcontext", false);
} else {
event.target.setAttribute("class","enabled");
personasrotatorprefsinstance.setBoolPref("extensions.personasrotator.showpersonasrotatortabnormalcontext", true);
}
},
prefilluploadformcheckboxOncommandHandler : function (event){
var personasrotatorprefsinstance = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
if (event.target.getAttribute("class")=="enabled") {
event.target.setAttribute("class","disabled");
personasrotatorprefsinstance.setBoolPref("extensions.personasrotator.prefilluploadform", false);
} else {
event.target.setAttribute("class","enabled");
personasrotatorprefsinstance.setBoolPref("extensions.personasrotator.prefilluploadform", true);
}
},
logalertenabledcheckboxOncommandHandler : function (event){
var personasrotatorprefsinstance = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
if (event.target.getAttribute("class")=="enabled") {
event.target.setAttribute("class","disabled");
personasrotatorprefsinstance.setBoolPref("extensions.personasrotator.logalertenabled", false);
} else {
event.target.setAttribute("class","enabled");
personasrotatorprefsinstance.setBoolPref("extensions.personasrotator.logalertenabled", true);
}
},
}
window.addEventListener("load",PersonasRotatorOptions.load,false);